package com.maegul.data.entities;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


/**
 * The persistent class for the cart_items database table.
 * 
 */
@Entity
@Table(name="cart_items")
public class CartItem extends AbstractEntity {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private int id;

	//uni-directional many-to-one association to MediaItem
    @ManyToOne
	@JoinColumn(name="media_item", referencedColumnName="name")
	private MediaItem mediaItemBean;

	//bi-directional many-to-one association to User
    @ManyToOne
	@JoinColumn(name="username", referencedColumnName="username")
	private User user;

    public CartItem() {
    }

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public MediaItem getMediaItemBean() {
		return this.mediaItemBean;
	}

	public void setMediaItemBean(MediaItem mediaItemBean) {
		this.mediaItemBean = mediaItemBean;
	}
	
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}
	
}